package com.snimay.app.user.vo;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.snimay.heibernate.Annotation.table;

/**   
 * @Title      : User.java
 * @Package    : com.snimay.users.vo
 * @Description: TODO 
 * @author     : xxy
 * @date       : 2018年4月27日 下午5:36:41
 * @version    : V1.0   
 */
@Entity
@Table(name = "SYS_User")
@table(query = "name", name = "用户管理",size=10)
public class User {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long id;
	
	public String username;
    public String password;
    
    @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)  
	@JoinColumn(insertable=true,updatable=true,name="user")
    public Set<UserInfo> info;
    
    @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)  
	@JoinColumn(insertable=true,updatable=true,name="user")
	public Set<UserRole> role;
}
